package com.selftaught.domain.hcpatientinfo;

import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * XmlRequestBuilder
 *
 * @author huya
 * @date 2025-10-23
 */
@Component
public class XmlRequestBuilder implements Serializable {

    private static final String XML_REQUEST_TEMPLATE =
            "<Request>" +
                    "<header>" +
                    "<UserID></UserID>" +
                    "<DeviceID></DeviceID>" +
                    "<AppCode></AppCode>" +
                    "<ReqTime></ReqTime>" +
                    "<ReqTraceNo></ReqTraceNo>" +
                    "</header>" +
                    "<body>" +
                    "<itemType></itemType>" +
                    "<itemNo>%s</itemNo>" +
                    "</body>" +
                    "</Request>";

    /**
     * 构建请求 XML
     *
     * @param itemNo itemNo
     * @return 完整的 XML 请求字符串
     */
    public String buildRequestXml(String itemNo) {
        return String.format(XML_REQUEST_TEMPLATE, itemNo);
    }
}
